<HTML><HEAD><TITLE>min(+Number1, +Number2, -Minimum)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>min(+Number1, +Number2, -Minimum)</H1>
Unifies the minimum of Number1 and Number2 with Minimum.


<DL>
<DT><EM>Number1</EM></DT>
<DD>A number.
</DD>
<DT><EM>Number2</EM></DT>
<DD>A number.
</DD>
<DT><EM>Minimum</EM></DT>
<DD>A variable or a number.
</DD>
</DL>
<H2>Description</H2>
   This predicate is used by the ECLiPSe compiler to expand evaluable
   arithmetic expressions.  So the call to min(Number1, Number2, Minimum)
   is equivalent to
<PRE>
	Minimum is min(Number1, Number2)
</PRE>
    which should be preferred for portability.
<P>
   In coroutining mode, if Number1 or Number2 are uninstantiated, the call
   to min/3 is delayed until these variables are instantiated.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>min(+, +, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Number1 or Number2 is not instantiated (non-coroutining mode    only).
<DT><EM>(24) number expected </EM>
<DD>Number1 or Number2 is not of a numeric type.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      min(5, 2, 2).
      min(2_3, 3_4, 2_3).
      min(5.0 , 2.0, 2.0).
      min(5.0, 2, 2.0).         (The types are adjusted)
      min(5_0, 2, 2_0).         (The types are adjusted)
Fail:
      min(1, 2, 3).
      min(1, 2, 2.0).
      min(5, 2.0, 5).
      min(5, 2, r).
Error:
      min(A, 2, 6).             (Error 4).
      min(4 - 2, 3, 3).         (Error 24).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/arithmetic/is-2.html">is / 2</A>
</BODY></HTML>
